function SimpleInstance(/*vec2*/ position, /*Image*/ sprite, /*Map*/ mapManager){
	this.position = position;
	this.sprite = sprite;
	this.mapManager = mapManager;
	this.subImg = null;
	
	this.name = null;
	this.message = null;
}

SimpleInstance.prototype.checkMouse = function(x, y){
	if (this.mapManager.message != null) return;
	
	var mouseP = this.mapManager.game.mouseP;
	var x2 = x + this.sprite.imgW;
	var y2 = y + this.sprite.imgH;
	
	if (mouseP.a > x && mouseP.a < x2 && mouseP.b > y && mouseP.b < y2){
		document.body.style.cursor = "pointer";
		return true;
	}
	
	return false;
};

SimpleInstance.prototype.draw = function(){
	var offset = this.sprite.offset;
	var x = this.position.a * config.gridSizeX - this.position.b * config.gridSizeX + this.mapManager.offset.a - offset.a;
	var y = this.position.a * config.gridSizeY + this.position.b * config.gridSizeY + this.mapManager.offset.b - offset.b;
	
	this.mapManager.game.eng.drawSprite(this.sprite, this.subImg, vec2(x, y));
	
	if ((this.name !=  null || this.message != null) && this.checkMouse(x, y)){
		if (this.name != null)
			this.mapManager.drawName(x + this.sprite.imgW / 2, y, this.name);
		if (this.message != null && this.mapManager.game.getMousePressed()){
			this.mapManager.message = this.message;
		}
	}
};

SimpleInstance.prototype.loop = function(){
	this.draw();
};
